Skip to content

Conversation

@hugiex
Copy link
Contributor

@hugiex hugiex commented Oct 17, 2025

Summary

Adds Astro language server for .astro files.

Changes

• Added Astro LSP configuration (packages/opencode/src/lsp/server.ts)
• Auto-installs @astrojs/language-server when not available
• Resolves TypeScript SDK path from project's node_modules (required by Astro LSP)
• Passes typescript.tsdk initialization option to enable TypeScript features
• Registered .astro file extension (packages/opencode/src/lsp/language.ts)
• Updated LSP documentation (packages/web/src/content/docs/lsp.mdx)

Technical Details

The Astro language server requires the typescript.tsdk initialization option pointing to TypeScript's library directory
Related

Testing

Astro project

LSP Attachment Log - filtered log on editing .astro extension file

INFO  2025-10-17T12:13:46 +3ms service=lsp serverIds=deno, typescript, vue, eslint, gopls, ruby-lsp, pyright, elixir-ls, zls, csharp, rust, clangd, svelte, astro, jdtls enabled LSP servers
INFO  2025-10-17T12:14:47 +7ms service=lsp serverID=astro spawned lsp server
INFO  2025-10-17T12:14:47 +0ms service=lsp.client serverID=astro starting client
INFO  2025-10-17T12:14:47 +1ms service=lsp.client serverID=astro sending initialize
INFO  2025-10-17T12:14:47 +447ms service=lsp.client serverID=astro initialized
INFO  2025-10-17T12:14:47 +1ms service=lsp.client serverID=astro  textDocument/didOpen
INFO  2025-10-17T12:14:49 +766ms service=lsp.client serverID=astro  textDocument/publishDiagnostics
INFO  2025-10-17T12:14:49 +74ms service=lsp.client serverID=astro  textDocument/publishDiagnostics
INFO  2025-10-17T12:14:59 +0ms service=lsp serverID=typescript spawned lsp server
INFO  2025-10-17T12:14:59 +0ms service=lsp.client serverID=typescript starting client
INFO  2025-10-17T12:14:59 +0ms service=lsp.client serverID=typescript sending initialize
INFO  2025-10-17T12:14:59 +0ms service=lsp.client serverID=typescript initialized
INFO  2025-10-17T12:14:59 +1ms service=lsp.client serverID=typescript  textDocument/didOpen
INFO  2025-10-17T12:14:59 +0ms service=lsp.client serverID=typescript  textDocument/didOpen
INFO  2025-10-17T12:14:59 +4ms service=lsp.client serverID=typescript  textDocument/publishDiagnostics
INFO  2025-10-17T12:14:59 +11ms service=lsp.client serverID=typescript token=66713253-ea61-45a6-94da-94f60d552f76 window/workDoneProgress/create
INFO  2025-10-17T12:15:01 +87ms service=lsp.client serverID=typescript  textDocument/publishDiagnostics
INFO  2025-10-17T12:17:12 +39ms service=lsp.client serverID=typescript token=865ff6ee-1293-4766-9365-4482aacde6c1 window/workDoneProgress/create

@hugiex hugiex force-pushed the support-astro-lsp branch from b7ef0c2 to a9a24c3 Compare October 17, 2025 12:30
@hugiex
Copy link
Contributor Author

hugiex commented Oct 17, 2025

PS: Looking through the supported languages, it seems we don’t support the .lua extension yet (my favorite one 🤣). I’ll create a PR for it later

@hugiex hugiex marked this pull request as ready for review October 17, 2025 12:39
@rekram1-node
Copy link
Collaborator

nice thanks!

@rekram1-node rekram1-node merged commit 4d8268c into sst:dev Oct 20, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants